home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet Surfer: Getting Started
/
Internet Surfer - Getting Started (Wayzata Technology)(7231)(1995).bin
/
pc
/
textfile
/
mac_faqs
/
fortran_
< prev
next >
Wrap
Internet Message Format
|
1995-01-27
|
62KB
Xref: bloom-picayune.mit.edu comp.lang.fortran:11213 news.answers:4296
Path: bloom-picayune.mit.edu!enterpoop.mit.edu!spool.mu.edu!olivea!sun-barr!news2me.EBay.Sun.COM!exodus.Eng.Sun.COM!appserv.Eng.Sun.COM!appserv!khb
From: khb@chiba.Eng.Sun.COM (Keith Bierman fpgoup)
Newsgroups: comp.lang.fortran,news.answers
Subject: comp.lang.fortran frequently asked questions
Message-ID: <KHB.92Nov30193017@chiba.Eng.Sun.COM>
Date: 1 Dec 92 03:30:18 GMT
Expires: +1 month
Followup-To: poster
Organization: Sun MegaSystems
Lines: 1431
Approved: news-answers-request@MIT.Edu
NNTP-Posting-Host: chiba
Frequency: mostly monthly
Frequency: mostly monthly
Here are some answers to frequently asked questions. The "author", as
is the custom, has appropriated posted responses as seemed apt. I have
tried to leave attributions in, as correctly as possible. To anyone
who has been offended by omission or otherwise, my apologies. I shall
give priority to corrections regarding attribution.
No one takes responsibility for any of this text, neither the employer
of the "author", the "author", friends of the "author", pets of the
"author" nor anyone else.
Your mileage WILL vary.
If you have comments/suggestions/edit proposals please send them to me
(keith.bierman@eng.sun.com). I do not promise to accept 'em. I
encourage others to make better faq lists, so I can retire this one.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Questions:
Q0) How should one spell FORTRAN/Fortran?
Q1) Where can I get a copy of the Fortran 90 Standard? How about
electronic copies?
Q2) What Fortran 90 translators are available?
Q3) I have heard of fortran "lints" what are they, and where can
I get one?
Q4) "Why do people use FORTRAN?, C is so much better"
Q5) Why can't I get an electronic version of the standard?
Q6) Where can I get "foo" (some random package)
Q7) Where can I get a free compiler?
Q8) What is the best compiler for a PC?
Q9) How does Fortran 90 relate to FORTRAN '77 and what is Fortran 90?
Q10) My compiler is mis-behaving; who enforces the standard?
Q11) What are good books on Fortran?
Q12) Are there pretty printers for FORTRAN?
Q13) Why are there aimless debates?
Q14) How do I call f77 from C (and visa versa)
Q15) What constitutes good FORTRAN style?
Q16) For whatever reasons, I want to translate my Fortran into C.
What tools are available?
Q17) For whatever reasons, I want to translate my existing C code
into Fortran. What tools are available?
Q18) What is preprocessing, how can it help? How can it hurt?
Q19) How can I convert an existing FORTRAN 77 program to the free form
source of Fortran 90?
Q20) Who creates these silly standards anyway?
Q21) How can I read my VAX binary data somewhere else?
Q22) My F77 program compiled ok on a <system1>, but gives me heaps of
syntax errors on a <system2>. What's wrong?
Q23) My F77 program ran ok on a <system1>, but on a <system2> it just gives
me strange results. What's wrong?
Q24) Is there a WEB for Fortran (and what is web anyway)?
Q25) Where can I find coded BLAS (and what are coded BLAS?)
Q26) How common is DO ... END DO?
Q27) Where can I learn more about the history of Fortran?
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Q0) How should one spell FORTRAN/Fortran?
FORTRAN is generally the preferred spelling for discussions of versions of
the language prior to the current one ("90"). Fortran is the
spelling chosen by X3J3 and WG5. In this document a feeble effort
has been made to capitalize accordingly (e.g. vast existing
software ... FORTRAN vs. generic Fortran to mean all versions of
the standard, and specifically the modern dialect, ISO 1539:1991).
From: walt@netcom.com (Walt Brainerd)
There was an effort to "standardize" on spelling of programming
languages just after F77 became a standard. The rule: if you say
the letters, it is all caps (APL); if you pronounce it as a word,
it is not (Cobol, Fortran, Ada). See, for example the difinitive
article describing Fortran 77 in the Oct 1978 issue of the Comm.
of the ACM. The timing was such that FORTRAN got put on the
standard itself, though many always after that have referred to
it as Fortran 77. Of course, there are those who think it is not
truly Fortran if not written with all caps.
<ed note>
ISO 1539:1991 and its ANSI counterpart X3.198-1992 consistently
employ the spelling "Fortran" to refer to the language being
defined. Reference(s) to the older version employ "small caps"
for the "ORTRAN" characters.
Q1) Where can I get a copy of the Fortran 90 Standard?
From: julian@cernvax.cern.ch (julian bunn)
The new Fortran 90 standard has now been formally published
and is available from the ISO central secretariat or from the
national member bodies. The price is about $120. Some
ordering detail follow. I can supply addresses in other
countries not mentioned on request (to METCALF@CERNVM).
The document reference is ISO/IEC 1539 : 1991. There is no ISBN.
ISO
1, rue de Varembe
Case postale 56
1211 Geneva 20
Switzerland
Fax: +41 22 734 10 79
ANSI
1430 Broadway
New York, NY 10018
BSI
2 Park Street
London W1A 2BS
DIN
Burggrafenstrasse 6
Postfach 1107
D-1000 Berlin 30
AFNOR
Tour Europe
Cedex 7
92049 Paris La Defence
SCC
1200-45 O'Connor
Ottawa
Ontario K1P 6N7
Mike Metcalf
(metcalf@cernvm)
and from walt@netcom.com
For those of you who don't read comp.lang.fortran, you might be
interested to know that I (walt brainard) just called Global
Engineering to see if the sell ISO 1539:1991. They do; the price is
$225.
And
You can obtain copies through:
Global Engineering Documents
2805 McGaw Ave.
Irvine, CA. 92714
(714) 261-1455
(800) 854-7179
New ANSI number
ANSI X3.198-1992
How about electronic copies?
Return-Path: walt@netcom.com
Subject: ISO 1539 in electronic form
In accordance with an official agreement with
the International Standards Organization, Unicomp
is now able to distribute electronic versions of
the Fortran 90 standard: "ISO/IEC 1539 : 1991,
Information technology--Programming languages--Fortran".
The money received from this effort will go partly to
fund ISO activities and partly to recover the costs
incurred by Unicomp in preparing and typesetting the
standard document. The prices are set by ISO.
The document can be obtained in three versions:
1. An ascii version suitable for viewing on a
computer terminal using any kind of editor.
Cost: USD 125.
2. A PostScript version with a license allowing
the purchaser to print n paper copies.
Cost: USD 125 + 10n.
3. Complete source in ditroff with macros and
software to extract and create the annexes.
The source constitutes a fairly high level
marked up document; for example, each program
beginning and ending is marked and there
are few low-level typographic commands such
as size and font changes. Cost USD 1000.
I am quite enthused especially about version (2).
If you want to have 10 copies for your organization,
and it costs $10 to make a printed copy, then the
cost to make the 10 copies would be $125 + $200,
or just $32.50 per copy, which is a substantial
savings over purchasing paper copies.
Versions (1) and (3) will be accompanied by a
license restricting use to one CPU and prohibiting
copying, except for backup purposes, etc. The
version (2) license will prohibit distributing
any of the printed copies outside of the purchasing
organization.
If you have special requirements, such as wanting
to distribute a copy with each version of your compiler
or using the source as a part of your documentation,
we can make special arrangements, subject to the
approval of the ISO. Please advise me of your
requirements and we can work up a proposal together.
ISO and Unicomp think this will provide the often
requested access to the standard in electronic form.
This is the first time this is being tried, so we hope
that organizations will be careful to observe the rules
and encourage the continued availability of this
and other standards in electronic form.
Payment can be made by Visa or MasterCard, or with
a check on a US Bank in US funds. We will accept
a purchase order only if the amount is $500 or more.
Q2) What Fortran 90 translators are available?
From: schumanm@Informatik.TU-Muenchen.DE (Matthias Schumann)
From: macphed@dvinci.USask.Ca (Ian MacPhedran)
This is the promised summary of my request for information about
Fortran 90 (f90) compilers. I am sorry for the delay in getting this
posted, but I was away for a week, and still haven't caught up.
I received a large amount of information, including a previous summary.
Rather than parroting the entire list, I have prepared the following
breakdown of the points which interested me.
------------------------------------------------------------------------------
Product: NAGware Fortran 90 Compiler
Descript: Compiles f90 code to C source, or directly to executable
file under MS-DOS. Therefore requires native C compiler
as back end on most platforms.
Platform: Apollo DN10000, DECstations, HP 9000, IBM RS/6000, NeXT,
Intel 386/486 (MSDOS), Sun 3, Sun 4 (SunOS 4.1)
VAX/VMS forthcoming.
Pricing: Varies with platform. Academic Pricing available. Site
License available
+------------------------------------------------------------+
| NAGWare F90 Compiler |
+------------------------------------------------------------+
| License Fee Options for Initial Computer |
+------------------------------------------------------------+
| | Standard | Academic |
+--------+-------------------------+-------------------------+
| | Perpetual| Maintenance| Perpetual| Maintenance|
| | Fee | Fee | Fee | Fee |
+--------+-----------+-------------+-----------+-------------+
| CLASS 1| $895 | $160 | $537 | $97 | (MSDOS)
+--------+-----------+-------------+-------------------------+
| CLASS 2| $1,495 | $270 | $897 | $162 | (Low end work-
+--------+-----------+-------------+-----------+-------------+ stations)
| CLASS 3| $1,995 | $360 | $1,197 | $215 |
+--------+-----------+-------------+-----------+-------------+
| CLASS 4| $2,495 | $450 | $1,497 | $270 | (Server class
+--------+-----------+-------------+-----------+-------------+ computers)
| CLASS 5| $3,295 | $594 | $1,977 | $356 |
+--------+-----------+-------------+-----------+-------------+
| CLASS 6| $4,295 | $774 | $2,577 | $464 |
+--------+-----------+-------------+-----------+-------------+
| CLASS 7| $5,295 | $945 | $3,177 | $572 |
+--------+-----------+-------------+-----------+-------------+
(US Dollars)
Contact: Sheila Caswell, Account Manager,
Numerical Algorithms Group, Inc.
1400 Opus Place, Suite 200
Downers Grove, IL, USA
60515-5702
Phone: (708) 971-2337
Source: E-mail messages, postings, and paper mailing
------------------------------------------------------------------------------
Product: VAST-90
Descript: Converts f77 code to f90, and reverse. Will "de-spaghettify"
f77 code to a more structured form. Requires native f77 compiler
to compile f90 programs.
Platform: SPARC (Sun 4), IBM RS/6000
Pricing: Single Machine: starts at $1900, Sun, IBM HP and DEC
workstations. Higher prices for larger machines.
Included: VAST-90, f90 driver, f90 library and documentation.
Volume discounts and site license available.
Contact:
Pacific-Sierra Research Corp. Switchboard: (310) 314-2300
2901 28th Street Fax: (310) 314-2323
Santa Monica CA 90405 VAST-90 e-mail: dave@psrv.com
------------------------------------------------------------------------------
Product: PF90 Version 2.0
Descript: Converts f90 programs to f77, then compiles with native
f77 compiler. Therefore native f77 compiler is required.
Platform: Sun 4, IBM RS/6000, Silicon Graphics, DECstations, Convex,
Alliant, IBM 3090 (AIX), Cray
Pricing: Sun, RS/6000, SGI, DECstation: $2000
Convex, Alliant: $5000; IBM 3090, Cray: $10000
(US Dollars, single machine, multiuser license, must purchase
f77 compiler separately.)
Contact: ParaSoft Corporation
2500 E. Foothill Blvd
Pasadena, CA 91107
Phone: (818) 792-9941
E-mail: f90-info@parasoft.com
Source: E-mail messages, and PostScript advertisement
------------------------------------------------------------------------------
Product: PV version 1.1 of Fortran 90 compiler
Descript: Port of NAG's f90 compiler to MS-DOS, together with Salford
Software Ltd.
Platform: Intel 386/486 Computers
Pricing: $1950.00 (single user, US currency)
Contact: OTG Systems Inc
Phone: (717) 222-9100
Source: E-mail message/summary of previous queries
------------------------------------------------------------------------------
The following is from a previous summary from David Bernholdt:
Convex is reported to have an incomplete f90 compiler in beta.
Other compilers in preparation will be available:
EPC (Edinburgh Portable Compilers) and Lahey late 1992
Cray Research early 1993
DEC for VMS late 1993
------------------------------------------------------------------------------
I wish to thank the following people for their help, and apologize to any
which I have missed.
psrv!bob@uu.psi.com
naginc!caswell@sunbird.Central.Sun.COM
malcolm@nag.co.uk
roman@parasoft.com
khb@chiba.Eng.Sun.COM
METCALF@crnvma.cern.ch
----------------------------------------------------------------------------
Ian MacPhedran, Engineering Computer Centre, University of Saskatchewan.
2B13 Engineering Building, U. of S. Campus, Saskatoon, Sask., CANADA S7N 0W0
macphed@dvinci.USask.CA macphedran@sask.USask.CA
Walt Brainerd walt@netcom.com:
Yes, a Fortran 90 system can be had for $99.
Salford FTN90 is a full PC Fortran 90 implementation based
on the front end developed by the Numerical Algorithms
Group, Ltd. The Entry Level system requires that
all parts of a program reside in one file. That file
is compiled and executed without producing a permanent
executable file.
It runs on a 386SX, 386DX, or 486 system with DOS 3.3
or later.
The list price for Entry Level FTN 90 is $134, but until
the end of February, 1993, the Entry Level version is
available in North America at the introductory price of $99
from Unicomp. (We hope to make up in volume the amount
lost on each copy...8^) Contact Unicomp for ordering
information.
To find out the price and how to get it outside of North
America, contact Salford Software, Venables Building,
5 Cockcroft Road, Salford, M5 4NT, United Kingdom,
+44 61 745 5678, +44 61 745 5666 (fax).
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Q3) I have heard of fortran "lints" what are they, and where can
I get one?
Fortran compilers are not required (and most do not) to protect
users from themselves, that is to say
call sub(1)
...
subroutine sub(i)
i=i+10
return
end
Is non-standard complying but the compiler need not tell you about
it. Arguably worse, the compiler can produce any result it deems
fit, up to and including the start of world war III (assuming the
right optional hardware has been installed).
Fortran lint programs focus on searching out search programming
errors and alerting the user.
There are a wide variety of commercial and pd products. A partial
list follows:
IPT FORTRAN lint 1096 East Meadow Circle, Palo Alto, CA 94303, 415/494-7500.
Forwarn from quibus 719 527 1384.
QA-FORTRAN from PRL UK 01 942 9242 and perhaps (817) 589 0949
FORCHECK from Leiden University ND 31 71 276804
FTNCHEK from netlib. One may receive FTNCHEK by mailing to
netlib@ornl.gov the following message:
send ftnchek from fortran
And Ajay Shah, (213)749-8133, ajayshah@usc.edu
You may want to mention f2c followed by an ANSI C compiler as a great
free fortran lint. I could not have survived writing fortran if it
were not for f2c. You need to know some C to deal with the error
messages, but that's not a bad price to pay.
From: "John D. McCalpin" <mccalpin@perelandra.cms.udel.edu>
Not too many people use it, but you might want to add TOOLPACK to
the list of FORTRAN "lint" packages. Here is the blurb that I
send to people who are interested:
======================================================================
TOOLPACK is a large set of utilities written in FORTRAN to do FORTRAN
code analysis and transformation.
TOOLPACK begins by actually parsing the program with a fully FORTRAN-
compliant parser and then does all the code transformations on the
parse and comment trees.
This means that you cannot confuse TOOLPACK by silly FORTRAN-isms that
can easily overwhelm more naive utilities (such as ftnchek). For
example, TOOLPACK correctly handles statements such as:
D O U B L E P R E C I S I O N A(100,100)
doubleprecision fred
DO I = 1.2
READ(I,J) = 10.
The usual interface to TOOLPACK is a set of 'csh' scripts that run the
various TOOLPACK utilities to do specific tasks.
The ones you will find most useful are: pol, polx, apt, dapt, decs,
getlst, and discard. These are the prettyprinter, precision converter,
declaration standardizer, and some necessary utilities. See below for
more details.
By aware that TOOLPACK is *very* rigorous about the FORTRAN-77
standard. You may or may not consider this an advantage.
The scripts are described by the 'scripts' script, which delivers the
following:
----------------------------------------------------------------------------
In the Toolpack script summaries below, the section numbers refer to
the Unix environment Users' Guide where more detailed information can
be found. To obtain on-line information about a script's usage, type
its name without any arguments.
FORTRAN Analysis Facilities
getlst Produce a listing showing statement and token numbers. Report
lexical scanning warnings and errors. (3.1.1)
syn Report errors and warnings detected by lexical scanning, parsing,
and examining a set of symbol attributes. (3.1.2)
sem Report errors and warnings detected by lexical scanning, parsing,
and examining an extended set of symbol attributes. (3.1.3)
pfort Report errors and warnings detected by lexical scanning, parsing,
examining an extended set of symbol attributes, checking for unsafe
references, and checking conformance to a portable subset of
FORTRAN. (3.1.4)
statdoc In a user-supplied report template, place information derived from
static analysis to assist in documenting the program. Examples of
information the user may request are COMMON block usage, symbol
attributes, and a graph of subprogram calls. (3.1.5)
inst Instrument a FORTRAN program so that the instrumented program, when
executed, produces information about program execution. (3.2.1)
rundoc Execute a program instrumented by inst and, in a user-supplied
report template, place information derived from dynamic analysis
to assist in documenting the program. For example, the user may
determine the frequency of execution of program segments. (3.2.2)
FORTRAN Transformation Facilities
pol Format a FORTRAN program under control of user-supplied options
in a Polish option file. (4.1.1)
polx Construct a Polish option file via a menu-driven editor. (4.1.2)
decs Rebuild the declarative part of a FORTRAN program. (4.2.1)
apt Transform a single-precision version of a FORTRAN program to
double precision or vice versa. (4.3.1)
dapt Convert precision and rebuild the declarations, combining the
functions of apt and decs. (4.3.2)
cname Change the names in a FORTRAN program that satisfy conditions
derived from information in either the lexical token stream or
the symbol table or both. (4.4.1)
lname Transform a FORTRAN program containing long names to a program
with standard names. (4.4.2)
stf Rebuild the flow of control in a FORTRAN program to standardized
form. (4.5.1)
ucs Transform nests of DO loops matching certain paradigms so that
the transformed code executes more efficiently on vector machines.
(4.6.1)
Miscellaneous Facilities
fdiff Compare two FORTRAN programs at the lexical token level. (5.1.1)
dac Compare two data files, neglecting certain formatting differences
and numerical differences smaller than a given tolerance. (5.1.2)
vcon Create, edit, and retrieve versions of a file contained in a
version file. (5.2.1)
discard Remove unneeded files created by the above scripts. (5.3.1)
scripts Print this summary of the scripts. (5.4.1)
----------------------------------------------------------------------------
TOOLPACK can be obtained by anonymous ftp from perelandra.cms.udel.edu
in the directory pub/Lang/Toolpack/.
The UNIX version is in the file toolpack.tar.Z
Serious hackers will want the versions in the Distrib directory.
The package is known to compile on Silicon Graphics and Sun machines,
though the Makefile is reasonably braindamaged.
You will need about 16 MB for the stripped executables on an SGI machine.
Figure on double that for compiling the package.....
Have fun!
--
John D. McCalpin mccalpin@perelandra.cms.udel.edu
Assistant Professor mccalpin@brahms.udel.edu
College of Marine Studies, U. Del. John.McCalpin@mvs.udel.edu
Q4) "Why do people use FORTRAN?, C is so much better"
One should avoid such pointless arguments .... if you feel this
way, don't subscribe to comp.lang.fortran.
This sort of question always triggers off a protracted discussion,
the highlights of which are typically:
a) FORTRAN and C have different semantics. A FORTRAN optimizer
knows more about aliasing, function interactions, and I/O. A
C optimizer has to infer or compute such information. C
bigots typically have neither written such optimizers nor
worked with folks who do it for a living, and are prone to
dismiss such arguments as being petty and neolithic.
FORTRAN programmers are often a bit more in touch with high
performance computing, and are unwilling to bet that heavily
on compiler wizardry.
In addition, ANSI/ISO C has very tight requirements on
expression evaluation (an overreaction to the K&R ignore
parenthesis days) which cripples an optimizer even further.
The restrictions are spelled out in Section 5.1.2.3 of
ISO/IEC 9899-1990. Both the '77 and '90 Fortran standards
allow the optimizer more latitude.
Of course, compiler options, vendor extensions and the like
sometimes narrow the difference. Also, some Fortran
compilers do not take advantage of all of these features of
the language, thus narrowing the gap in the other direction.
On any given code, on any given system, all bets are off.
b) There is a vast body of existing FORTRAN code (much of which
is publically available and of high quality). Numerical
codes are particularly difficult to "vet", scientific
establishments usually do not have large otherwise idle
programming staffs, etc. so massive recoding into any new
language is typically resisted quite strongly.
c) Fortran tends to meet some of the needs of scientists
better. Most notably, it has built in support for:
- variable dimension array arguments in subroutines
- a compiler-supported infix exponentiation operator which
is generic with respect to both precision and type,
*and* which is generally handled very efficiently or
the commonly occuring special case floating-point**small-integer
- complex arithmetic
- generic-precision intrinsic functions
d) Retraining staff is quite expensive.
e) It is sometimes argued that:
- Jonathan Thornburg <also responsible for misc. other fixups>
Fortran tends to be easier for non-experts to learn
than C, because its "mental model of the computer" is
much simpler. For example, in Fortran the programmer
can generally avoid learning about pointers and memory
addresses, while these are essential in C. More generally,
in Fortran the difference between (C notation) x, &x,
and often even *x is basically hidden, while in C it's
exposed. For non-experts this makes Fortran a considerably
simpler language.
Because of this relative simplicity, for simple programming
tasks which fall within its domain, (say writing a simple
least-squares fitting routine), Fortran generally requires
much less computer science knowledge of the programmer than
C does, and is thus much easier to use.
Q5) Why can't I get an electronic version of the standard?
Someday, perhaps you can. However, at the moment the various
standards bodies finance some fraction of their work via sales of
standards documents. ISO and ANSI have both claimed copyright to
the finished standard, so those who would make and distribute
copies should be forewarned.
It should be noted that various people are working to correct
this; but it is unlikely to ever become free.
Q6) Where can I get "foo" (some random package)
Q6) Where can I get "foo" (some random package)
contributed by:
Marc R. Roussel
mroussel@alchemy.chem.utoronto.ca
Use archie. archie is an online database of what is available and
where on the "net". Archie can be used either via telnet or by
mail.
For information about archie send
mail archie@archie.rutgers.edu
subject: help
And you will get back copious directions on how to use archie. If
you prefer interactive experimentation, telnet to
archie.rutgers.edu and log in as archie. No password will be
required. The first thing you will be shown is a list of other
archie servers. If one of these servers is geographically much
closer to you than Rutgers, NJ, please disconnect (by typing 'quit')
and use that one. To save you this step, here is the latest list of
archie sites:
archie.rutgers.edu 128.6.18.15 (Rutgers University)
archie.unl.edu 129.93.1.14 (University of Nebraska in Lincoln)
archie.sura.net 128.167.254.179 (SURAnet archie server)
archie.ans.net 147.225.1.2 (ANS archie server)
archie.au 139.130.4.6 (Australian server)
archie.funet.fi 128.214.6.100 (European server in Finland)
archie.doc.ic.ac.uk 146.169.11.3 (UK/England server)
archie.cs.huji.ac.il 132.65.6.15 (Israel server)
archie.wide.ad.jp 133.4.3.6 (Japanese server)
I believe that all of these servers run the mail server as well as
the telnet and archie server software. (The archie server is a
third way to use archie. It's probably the best way, but it
requires that you install software.)
Once you logged into an archie server, you will want to make
sure that all the information you will retrieve will be mailed to
you. Type
set mailto userid@machine.foo.edu
where, of course, you will substitute your own email address for the
made-up one shown above. You are now ready to search the database.
If at any time you want to know what options are available to you,
type help. To search for a program or file, type
prog foo
where foo is the name of the program or file required. Once your
search is done, type 'mail' to have the output sent to you. (The
output will almost always be several pages long.) Then type 'quit' to
exit.
Q7) Where can I get a free compiler?
One such is f2c.
From: mwm@a.gp.cs.cmu.edu (Mark Maimone)
Newsgroups: comp.lang.fortran,comp.lang.c
Subject: Re: Fortran to C translator
Keywords: fortran, C, translator, f2c
Date: 13 Sep 90 01:43:30 GMT
Organization: Carnegie-Mellon University, CS/RI
Since there have been several requests for a Fortran to C translator
in the past week, I'm reposting the announcement about f2c. The short
answer is you can get f2c by anonymous-ftp from research.att.com in
directory dist/f2c.
------------------------------------------------------------------------------
Source for f2c, a Fortran 77 to C translator jointly developed by
folks from Bell Labs, Bellcore, and Carnegie Mellon, is now freely
available.
F2c was derived from the original UNIX operating system's f77(1),
and the generated C follows f77's calling conventions; on some machines, the
resulting object files are interchangeable with (and behave
indistinguishably from) objects compiled by f77. The main "advantage" of
f2c is that it converts ANSI standard Fortran 77 into C without manual
intervention, at least when invoked by a suitable script or makefile (that
may need to exercise an f2c option to ensure that COMMON blocks are defined
just once). The main "problems" are that f2c does no code restructuring
(e.g., gotos are preserved) and that Fortran I/O gets converted into a bunch
of calls; thus the translated C code doesn't look too pretty, and in general
one would need to maintain the Fortran rather than its translation into C.
[F2c is not meant to displace the services of commercial vendors whose
business is to convert Fortran into maintainable C.]
There is a plethora of options, many of which exist to support
different compilation environments for the translated C (e.g., ANSI C or C++
compatibility, different type sizes, separate files for COMMON blocks to
appease "smart" linkers). So far f2c (and f2c-generated source) has
compiled successfully on many machines: Sun, Vax, IBMRT, Apollo, SGI, MIPS,
and Cray to name a few.
F2c has been under test by the net community for over a year
and has been verified on the NBS tests, several large math libraries,
floating point tests, even code for laying cable on the ocean floor!
To find out about f2c, send the following E-mail message to netlib
(netlib@research.att.com or research!netlib):
send index from f2c
Your message will be answered automatically (by a program -- see CACM vol.
30 #5 (May, 1987), pp. 403-407). You will receive a reply explaining how to
automatically acquire f2c source (about 600K), f2c library source (130K),
and supporting info (man page, etc). Or you can anonymous-FTP to
research.att.com and look in directory dist/f2c at these files:
all.Z -- 250K compressed shar file for f2c
f2c.ps.Z -- 24 page tech report describing f2c
index -- general info about files
libf77.Z, libi77.Z -- compressed shar files for libraries
****************************** DISCLAIMER ******************************
Careful! Anything free comes with no guarantee.
************************************************************************
----------------------------------------------------------------------
Mark Maimone phone: (412) 268 - 7698
Carnegie Mellon Computer Science email: mwm@cs.cmu.edu
cmcspt!mwm@cs.cmu.edu
Notes: f2c accepts only fairly vanilla FORTRAN; vendor supplied f77's
usually produce better quality code, and accept a wider variety
of codes.
Q8) What is the best compiler for a PC?
There are many products, some are quite good. Few are free.
f2c and gcc can be had for the PC environment. Popular ones are:
Lahey (very fast compilation; excellent reputation for support)
Watcom (touted for good optimization)
MicroWay (support for odd floating point units)
LPI (multi-platform support)
MicroSoft (various good hooks into windows and such)
Absoft (multi-platform support)
It is beyond the scope of a faq to provide a commercial endorsement.
Q9) How does Fortran 90 relate to FORTRAN '77?
With a few minor exceptions, Fortran 90 is a superset
of X3.9-1978 FORTRAN.
But this does not mean that all "77" codes will port sans changes.
Many (if not most) programmers employed constructs beyond the '77
standard, or rely on unspecified behavior (say, assuming that an OPEN
of an existing file will position the file pointer to just past the
last record already written) which has changed (that is to say, has
become specified).
This leads to the obvious question, what is new in Fortran 90?
A complete answer would require considerable text. Some of the most
obvious additions are:
1) array notation (operators, etc.)
2) dynamic memory allocation
3) derived types and operator overloading
4) keyword argument passing, INTENT (in, out, inout)
5) modules
6) modern control structures
7) free format source code form
8) other stuff
While it is always tricky to characterize the motives of a large group
of people, I <khb> am inclined to try as follows:
'90 incorporates two sets of improvements: (1) relatively minor
fixups that *could* have been done earlier (2) relatively major
changes to enable better software engineering practices.
Sometimes a "minor" fixup has major effect, such as addition of free
form source form combined with cannonization of the MIL-STD 1753
INCLUDE.
I further go off on a limb and assert that it was the goal of the
*committee* to evolve Fortran in a fashion to enable it to continue to
be the premier language for scientific computation.
Q10) My compiler is mis-behaving; who enforces the standard?
ANSI and ISO standards do not usually have a particular enforcement
mechanism. Local bodies sometimes do.
However, it should be borne in mind that if *your* source code is
not standard compliant there is *NO* obligation for a FORTRAN ('77
and before) compiler to do *ANYTHING* in particular. In Fortran (90)
the text in "constraints" must be tested and a warning produced
(compiler option can be used to evade this, of course).
Some (notably Guy Steele, with respect to another standard) have
noted that when non-standard complying code is encountered, a
compiler may do *ANYTHING* including initation of Global Warfare.
Keep this in mind.
When you do find a bona fide compiler bug, you are generally best
served by reporting it to the *vendor*. If you neglect to tell the
vendor, how can you complain about it not being fixed?
When reporting a *suspected* bug be sure to be quite specific
about the computer system, operating system rev level (patches
applied if known) and *compiler*version* (and patches thereof).
It is very hard for people to read your mind; but they will try.
The attempts are often entertaining, sometimes helpful, but always
an inefficient use of people-time and net-bandwidth.
Also note that it is generally helpful if you cut down the example
to the smallest size you can. Vendors are developers too; the
tendency is invest time/money where one can get the biggest bang
for the buck.
Q11) What are good books on Fortran?
Don't know if they are good. Inclusion in the list is not
endorsement. Have misplaced name of the compiler of the
original list <sorry>
Author Title Year
Kruger Efficient Fortran Programming 1990
Mojena/Ageloff FORTRAN 77 1990
Metcalf/Reid FORTRAN 90 EXPLAINED 1990
Boyle FORTRAN 77 PDQ 1989
Bezner FORTRAN 77 1989
Tremblay PROGRAMMING IN FORTRAN 77 1988
Salmon ... ENGINEERS & SCIENTISTS WITH FORTRAN 77 1988
Nyhoff/Leestma FORTRAN 77 FOR ENGINEERS & SCIENTISTS 1988
McCracken/Salmon ... ENGINEERS & SCIENTISTS WITH FORTRAN 77 1988
Davis/Hoffman FORTRAN 77: A STRUCTURED DISCIPLINED STYLE 1988
Barnard/Skillicorn FORTRAN 77 FOR ENGINEERS AND SCIENTISTS 1988
Mashaw PROGRAMMING STRUCTURED FORTRAN 77 1987
Cole FORTRAN 77: A STRUCTURED ... APPROACH 1987
Boillot UNDERSTANDING FORTRAN-77 1987
Starkey/Ross FUNDAMENTAL PROGRAMMING WITH FORTRAN 77 1986
Rouse/Bugnitz INTRODUCTION TO FORTRAN 77 1986
Ratzer FORTRAN 77 COURSE 1986
Page FORTRAN 77 FOR HUMANS 1986
Lehman ... SOCIAL SCIENCES: ALGORITHMS & FORTRAN 77 1986
Smith FORTRAN 77: A PROBLEM-SOLVING APPROACH 1985
Shelly FORTRAN 77: AN INTRODUCTION 1985
Nickerson FUNDAMENTALS OF FORTRAN 77 PROGRAMMING 1985
Metcalf EFFECTIVE FORTRAN 77 1985
McKeown STRUCTURED PROGRAMMING USING FORTRAN 77 1985
Hume FORTRAN 77 FOR SCIENTISTS & ENGINEERS 1985
Dillman PROBLEM SOLVING WITH FORTRAN 77 1985
Brainerd FORTRAN 77 FUNDAMENTALS AND STYLE 1985
Borse FORTRAN 77 & NUMERICAL METHODS FOR ENGINEERS1985
Adman FORTRAN 77 SOLUTIONS NON-SCIENTIFIC PROBS. 1985
SSI, Inc. Staff FORTRAN 77 REFERENCE 1984
Etter PROBLEM SOLVING WITH STRUCTURED FORTRAN 77 1984
Etter PROBLEM SOLVING USING FORTRAN 77 ?
Dyck FORTRAN 77: A STRUCTURED APPROACH ... 1984
Chivers/Clark FORTRAN 77: A HANDS ON APPROACH 1984
Adman FORTRAN 77 FOR NON-SCIENTISTS 1984
Willamson/Levesque * A GUIDEBOOK TO FORTRAN ON SUPERCOMPUTER 1989
Rule FORTRAN 77: A PRACTICAL APPROACH 1983
Rouse/Bugnitz PROGRAMMING THE IBM PC: FORTRAN 77 1983
Nyhoff/Leestma PROBLEM SOLVING WITH FORTRAN 77 1983
Marateck FORTRAN 77 1983
Lehmnkuhl FORTRAN 77 1983
Law ANSI FORTRAN 77: INTRO. TO SOFTWARE DESIGN 1983
Holoien/Behforooz ... STRUCTURED PROGRAMMING WITH FORTRAN 77 1983
Grout FUNDAMENTAL ... PROGRAMMING USING FORTRAN 77 1983
Fleming/Redish THE U. S. MC MASTER GLOSSARY OF FORTRAN-77 1983
Cole ANSI FORTRAN IV WITH FORTRAN 77 EXTENSIONS 1983
Wu ANSI FORTRAN IV & 77 AND BUSINESS PROGRAMS 1982
Pollack STRUCTURED FORTRAN 77 PROGRAMMING 1982
Katzan FORTRAN 77 1982
Gibson/Young INTRODUCTION TO PROGRAMMING USING FORTRAN 77 1982
Ellis STRUCTURED APPROACH FORTRAN 77 PROGRAMMING 1982
Durgin FORTRAN 77 1982
Nanney A PROBLEM-SOLVING APPROACH USING FORTRAN 77 1981
Merchant FORTRAN 77: LANGUAGE AND STYLE 1981
Khailany BUSINESS PROGRAMMING FORTRAN IV/ANSI FORTRAN 1981
Ashcroft PROGRAMMING WITH FORTRAN 77 1981
Wagener FORTRAN 77 ?
Wagener PRINCIPLES OF FORTRAN 77 PROGRAMMING 1980
Meissner/Organick FORTRAN 77 FEATURING STRUCTURED PROGRAMMING 1980
Hume/Holt PROGRAMMING FORTRAN 77 1979
Balfour PROGRAMMING IN STANDARD FORTRAN 77 1979
Brainerd Programmer's guide to Fortran 90 1990
Adams et al Fortran 90 Handbook 1991
Counihan Fortran 90 1991
O'Reilly&Assoc Unix for FORTRAN Programmers 1990
Q12) Are there pretty printers for FORTRAN?
Yes.
One such is SPAG: OTG <usa> voice 717 222 9100 fax 717 229 9103
Authors are
Polyhedron Software Ltd
Magdalen House
98 Abingdon Road
Standlake
Witney
Oxon OX8 7RN
Tel 0865 300 579
Another is Fortran development Tools from Quibus 714 527 1384
Also FOR_STRUC from cobalt-blue. 404 518 1116
These more than pretty print, they optionally restructure your
code (duplicating code as needed to tidy up strange GOTO lists,
turning them into IF-THEN chains, and etc.).
From: dappel@grafted.UUCP (Dave Appel)
Newsgroups: comp.lang.fortran
Subject: Re: code beautifier wanted
Date: 4 Mar 92 21:30:25 GMT
Organization: GRAFTED, Central Indiana's Usenet BBS 317-881-4369
wg@cbnewsm.att.com (Bill Gieske) writes:
> I have tons of old FORTRAN code, most of it in upper case, the majority
> of it not indented. Is there a code beautifier, either PD or $$ that I
> can run the code through to improve the readability, hence the main-
> tainability?
> Reply to me direct. I will summarize if appropriate.
> Bill Gieske
> AT&T Bell Laboratories
> wg%alux2@att.research.com
Call "The Connection at 800-336-1166" and ask for
their software catalog.
In their catalog that I have, Sprint 1992, there is an
ad on page 39 from AutoCASE Technology. They have
a product called "AutoFLOW-FORTRAN" that lists for $1,995.
It claims to automatically document your existing source code.
AutoCASE's number is 408-446-2273.
On page 93 is an ad from POWERLINE Software Inc.
Their number is 800-257-5773, 206-623-9204. They offer
a product called SOURCE PRINT+, which they call a code
management tool with "multi-style formatting with structured
code blocking."
They have a Fortran/Basic version for $169, and a Delux
Multi-language version for $249. This program is for
DOS (MS-DOS presumably) Windows, and OS/2.
Hope this helps.
--
Dave Appel
The Grafted Branch BBS
317-881-4369
internet: dappel@grafted.UUCP
uucp: ..!uunet!grafted.UUCP!dappel
-= newsfeeds available, contact robert@towers.rn.com =-
Hindsight/Fortran
Summary:
Features include the ability to draw an interactive structure
chart and display coverage, software complexity and
performance information on the structure chart. There are also
code tracing features, for instance 3 logic diagrams are
produced. Common blocks can be traced through the structure
charts, including specific variables within common blocks.
Hindsight is excellent for documentation, code inspection, and
bringing new software engineers up to speed on new code.
For more information or a free demo copy, contact:
Dan Zimmerman, National Account Manager
Advanced Software Automation, Inc.
3130A Coronado Dr
Santa Clara, 95054
Phone: 408 492-1668 Fax: 408 492-1669
Email: zimme@hindsight.com
Alternative contact (if Dan cannot be reached:
manny@hindsight.com (John Mansperger)
Hindsight/FORTRAN Version 1.0 features
Hindsight/FORTRAN Version 1.0 is a fully integrated software
maintenance, testing, and re-engineering environment which addresses
many problems of the software development cycle, from design to
maintenance.
Hindsight/FORTRAN Version 1.0 parses FORTRAN source code, decomposes
system structure, and from this analysis, produces a single database
from which all of Hindsight's charts, diagrams and reports are
produced. The results of Hindsight's analysis is a detailed picture
of the static structure of the software system, a representation of
the common and local data, and connections to the dynamically
collected run-time data. From this, Hindsight generates active
structure charts where the user can isolate logical subtrees to
analyze both the parents and the children of a selected function.
Hindsight collects and analyzes performance, complexity, and test
coverage data. With the structure chart, the user can display this
data in a graphical and easy to use format. From the structure chart,
the user can edit multiple functions at a time without having to
specify the file or directory path where the file exists. Hindsight
even displays the use of common blocks on the structure chart.
Lastly, Hindsight generates logic diagrams for the entire program,
provides point-and-click tracing between high-level and detailed logic
with active line numbers, and generates over fifty detailed reports.
All capabilities mentioned above are integrated in a menu
driven environment utilizing the OpenLook or Motif Graphical User
Interface. Engineers only need to specify a list of source files to be
analyzed and select the operation and parameters for their purposes.
Hindsight provides the ability for multiple diagrams and reports to be
produced simultaneously during a single Hindsight session.
Hindsight/FORTRAN Version 1.0 provides an innovative technique to
graphically represent a software system. The structure chart reflects
the system structure, from which the user can get a clear overview of
the program being examined. Hindsight also allows the user to view or
edit the original code with a click on any subprogram box in the
structure chart. A major time-saving advance is Hindsight's ability
to reanalyze an edited function and update the structural database
without reanalyzing the entire system. The J-Diagram and ActionPlus
diagram are two graphical representations of the logic in a software
system and can contain a single module or the entire system. Both
diagrams utilize the active line number technique to link high-level
module calls with detailed module logic. Hindsight also actively
links computed GOTO statements with their destination labels by
clicking on the label. Users can walk through programs and trace the
logic without having to memorize the directories and files where
subprograms are defined and called. This technique saves a great deal
of the users time.
Hindsight/FORTRAN Version 1.0 has many integrated automated tools to
generate documents either on-screen or on paper. Because the documents
are automatically generated, they can be updated as soon as engineers
have modified their source code. This approach guarantees the
consistency between the design documents and the source code. The
updated and correct documents will be of great value in maintaining
and improving software products. These documents are available
on-line to the user and readily accessible through Hindsight's
interactive report mechanism.
Hindsight Version 1.0 has the ability to provide segment or line test
coverage data. Hindsight generates test coverage data and displays
the data on the structure chart in a statistical way. Hindsight can
also display the precise location of testing deficiencies on the
J-Diagram, which helps engineers find the exact part of the program
where the code has not been tested. Hindsight's ability to display
performance data, complexity metrics, and test coverage data on charts
and diagrams play an important role in controlling program quality.
Hindsight/FORTRAN Version 1.0 uses a new notation for the J-diagram
which accommodates branch test coverage capability. The new notation
has a better and more precise method of showing control levels,
complexity, and segment number counting. The branch test coverage
data generation and display is a great enhancement for test coverage
analysis. Hindsight's branch test coverage is able to detect
invisible branches, finding more problems that would otherwise be
hidden in programs. With this information, users can add test cases
for covering the untested code.
Hindsight/FORTRAN Version 1.0 contains the ability to speed up the
development process by generating a specific order for coding the
modules of a users system. By analyzing a group of modules containing
nothing more than empty shells of subprograms that call the other
subprograms in the system, Hindsight generates the coding order for
the modules to ensure that the process will be testable with the use
of a single driver process and without the need to stub out uncoded
subprograms. The bottom-up coding approach saves time that would be
wasted coding unneeded stubs. As development proceeds, Hindsight's
ability to verify that calls to other subprograms are utilizing the
proper interface will also save time and improve program quality.
Other tools:
Refine/FORTRAN ("re-engineering tool")
Reasoning Systems Inc
415 494 6201
FORM (graphical interface to toolpack)
University of Kent 44 227 762811
pub/fortran/fxref.tar.Z from biome.bio.ns.ca.
create cross reference of a FORTRAN program.
CLEAN77 available from Purdue University.
Mail Greg Flint (afc.klaatu.cc.purdue.edu) for more info.
There is a program called TIDY that is available via
FTP from simtel20 pub/msdos/fortran/tidy621.zip on
oak.oakland.edu
Q13) Why are there aimless debates?
There are some persistent individuals who would like computer systems
to work in a fashion somewhat unlike they do now. It seems pointless
to debate with them; the debates (in various groups) always take
the same form and never result in meaningful dialog.
One can usually recognize such by reading a week or so's worth of
postings. Sometimes you may have to read for a month to recognize
such. When you do, please try to avoid triggering (or responding to)
such individuals.
Many (if not most) newsreaders support a feature entitled KILL files.
As you recognize individuals, you may wish to put them into your
local kill file. For example, the style employed by GNUS:
(gnus-kill "From" "hrubin@pop.stat.purdue.edu")
(gnus-kill "Subject" "test")
the first kills off all postings from the named individual,
the second kills off all postings including the beloved "test" string.
See your local NewsGod for details suitable for your local system.
Q14) How do I call f77 from C (and visa versa)
This is quite platform dependent. For Suns see the FORTRAN User's
Guide, Chapter 14.
There is a package available from usenet which attempts to make
this "quick and easy" for a wide range of platforms:
ftp.uu.net (137.39.1.9) Location: /comp.sources.misc/volume20
DIRECTORY rwxr-xr-x 512 Jun 27 1991 cfortran
It is on many other sites (around the world) too. See archie if
you need other pointers.
For some systems, you have to initialize a runtime system explicitly
if you call a different language, and stopping execution from the
other program may not work.
Q15) What constitutes good FORTRAN style?
One rendition of a FORTRAN 77 style guide is available through anonymous
ftp from ics.uci.edu (128.195.1.1). To retrieve (please note that it's
not really "anonymous", that's just the Name that you'll be using):
% ftp ics.uci.edu
anonymous
<enter your e-mail address at Password: prompt>
cd pub/levine
ascii
get F77_Style_Guide
bye
If you can't access this site directly, please send an e-mail request to
levine@ics.uci.edu (BITNET: levine@uci, UUCP: ...!uunet!ucivax!levine).
Q16) For whatever reasons, I want to translate my Fortran into C.
What tools are available?
f90 from NAG, see above
f2c see above.
FORTRAN=C=FORTRIX=Rapitech Rapitech (914) 368-3000
FORTRAN=C=FOR_C=Cobalt Blue 404 518 1116
FORTRAN=C=PROMULA.FORTRAN=Promula (614) 263-5512
Q17) For whatever reasons, I want to translate my existing C code
into Fortran. What tools are available?
Regretably none. This is indeed unfortunate, as even a limited
translator could help with typical C header files.
Q18) What is preprocessing, how can it help? How can it hurt?
Preprocessing often refers to usage of a Macro-prepressor upon ones
source code prior to compilation.
How can this help?
It can make it easier to move code between machines.
How can this hurt?
It can cause difficulties in compilation of the processed code; most (if
not all) macro-preprocessors know nothing about Fortran syntax and
code layout rules. So, a common problem is that after preprocessing
some text may be lost past "sacred" column 72. Those working with
compilers that optionally compile *past* line 72 should probably
employ that option when using a preprocessor.
Common prepressors are: cpp, m4, and ratfor. Many sites have their
own custom prepressors. Basic functions are:
1) definition of a symbol
2) conditional code selection based on a symbol
3) substition of a symbol by its definition
Traditional BSD Unix f77 processors treat a file named foo.F (as
opposed to foo.f) as one that should be run through cpp prior to
compilation "automatically".
Q19) How can I convert an existing FORTRAN 77 program to the free form
source of Fortran 90?
A program to do this, CONVERT, may be obtained by sending a request
to metcalf@cernvm.cern.ch.
Q20) Who creates these silly standards anyway?
Typically X3J3. X3J3 is an ANSI subcommittee dedicated to Fortran. WG5
is the ISO counterpart. WG5 owns responsibility for Fortran on an
international basis. WG5 has previously tasked X3J3 to do the work.
This arrangement continues.
WG5 is composed of Fortran users, vendors, and academics from several
ISO supporting nations. Delegates represent *their*countries* not
their companies; so several delegates from a single company is
permitted.
ANSI rules prohibit multiple voting delegates from the same company.
X3J3 is composed of users (aerospace, government labs, military, DECUS,
railroads, oil to name a few), vendors (IBM, CRI, Sun, Convex, DEC,
UNISYS, to name a few) and the odd academic (oxford, yale, liverpool, to
name a couple). Members need not be US citizens nor must their company
be US domiciled. Being a member of a standards group is typically
involves non-trivial work. To be effective, one should plan on at
least 8 weeks of time per year (those who are really doing the hard
work do far more). This time commitment is typically far more
expensive than the travel and membership costs.
X3J3 meetings are open to the public. There are typically 4 meetings a
year, typically 3 are in the US and 1 *may* be overseas (to precede or
follow the WG5 plenary session). Membership fees are levied by ANSI,
and are on the near order of $400 (plus an extra $300ish for those who
wish to be members of the US delegation to ISO). In addition,
attendees to a particular X3J3 meeting pay a "meeting fee" which
covers reproduction costs, snacks and etc.
WG5 has established various goals and targets for future work. Roughly
speaking 5yrs rather than 13years are the targets for future work.
Current work projects include cleanup and interpretations of Fortran
(90), features for future versions of the standard (e.g. parallel
processing, "object-oriented" technologies, etc.). In addition to work
done directly by X3J3, there is work on standardized modules, and OS
bindings taking place in other organizations. X3J3 would like to keep
track of such efforts, those involved are invited to inform X3J3 early
in their development efforts if possible. X3J3 is currently working
with X3H5, DIN (varying string character) and tracking the efforts of
HPFF.
New members are always welcome. Visitors are also; though it is very
hard to get a good grip on things in only one meeting!
Contact the X3J3 chair or vice-chair for more information:
jwagener@trc.amoco.com chair
mbsh@holstein.fc.hp.com vice-chair
Upcoming meetings are:
9 Nov - 13 Nov New Haven (Yale)
8 Feb - 12 Feb Ft. Lauderdale (Harris)
Q21) How can I read my VAX binary data somewhere else?
Some vendors provide bulit in methods (DEC provides this via
special options on the OPEN statement). Others provide library support
(on SPARC products, with the SunPro compilers, checkout convert_external)
In addition, Accerl8 provides a commerial tool. Contact:
Robert Hickler Tel (303) 863-8088
Accelr8 Technology Email robert@accelr8.com
for more information.
The following three Q's and A's based on email from:
ecmtwhk@ccu1.aukuni.ac.nz (Thomas Koenig)
Q22) My F77 program compiled ok on a <system1>, but gives me heaps of
syntax errors on a <system2>. What's wrong?
Most likely, the program was written with a line length greater than
72. If your compiler supports it, turn on the option for greater
line length (e.g. -e is not uncommon) ; otherwise, split up the
lines by hand, or via one of those pretty-printers/restructing
tools mentioned above.
Q23) My F77 program ran ok on a <system1>, but on a <system2> it just gives
me strange results. What's wrong?
There are different reasons why this could be. Possibly, your program
violates the standard in some way which is not caught by the compiler
on <system1>.
Many programs rely on variables to be initialized to zero when a
subroutine or function is first called, and also on the retention
of values between calls. While many compilers (VAX/VMX and IBM VS,
for example) exhibit this behaviour, compilers on newer
architectures often fill variables with garbage on each new
function call. This is permitted, according to the standard.
Initialize variables explicitly, and put the variables which you need
to keep across function calls into SAVE statements. Your compiler may
have an option to trap unititialized variables; use that to find the
trouble spots. Alternatively, compile using a flag which forces
static allocation of all variables.
Another problem might be that the accuracy of REAL and DOUBLE
PRECISION differs between different platforms; that can cause
roundoff error to wipe out your results or your program to go
into endless loops.
Yet another (and much more subtle) problem can occur if a lot of
formatted I/O is employed. The conversion from internal to
external representations can introduce very significant errors;
much worse on some platforms than others (doing correctly rounded
base conversion is expensive).
There are, of course, lots of other possibilities, these are just
a starting point.
Q24) Is there a WEB for Fortran (and what is web anyway)?
fweb is available via anonymous ftp; use archie(above) to
determine current location(s).
As for the more general question, what is WEB .... WEB is a
"literate" programming system created by Knuth (he of reference
book fame, and TeX fame, and etc.). It permits the programmer to
write code and documentation together. WEB takes the "high level
code and documentation" and creates real publishable
documentation (using TeX or LaTeX) and compilable code. WEB
versions for many languages are available.
Q25) Where can I find coded BLAS (and what are coded BLAS?)
The BLAS (basic linear algebra software) comes in several flavors:
BLAS-1, -2, and -3. These can be described as scalar, vector and
matrix-matrix levels. "Coded" BLAS are either hand coded in assembler,
or at least tweaked for a given machine. Some vendors provide these,
some are provided on the net (see archie) and some are marketed by
various commercial organizations.
In addition, it should be noted that BLAS-3 is very amenable to
parallel processing. Done cleverly, this could be done by a network of
processors over a net. DSS markets just such an implementation. Contact:
Mike Boucher
Dakota Scientific Software, Inc.
501 East Saint Joseph Street
Rapid City, SD 57701-3995
fax: (605) 394-1256
scisoft@well.sf.ca.us
for more information about their implementation.
Q26) How common is DO ... END DO
It is very common; and of course is part of Fortran 90.
Compilers claimed to *not* support it (much shorter list this
way)
1) Salford ftn77/Primos version
2) Prime f77 compiler
3) Microsoft Fortran for CP/M 8080/Z80 machines
4) Fujitsu VPxxx UXP/M compiler
Q27) Where can I learn more about the history of Fortran?
From: metcalf@apofort.cern.ch (Michael Metcalf )
The history of Fortran is documented in:
Annals of History of Computing, 6, 1, January, 1984 (whole issue).
Programming Systems and Languages (S. Rosen ed.), McGraw Hill, 1967, pp 29-47
(this is Backus's original paper).
History of Prorammining Languages (R.L. Wexelblat ed.), Academic Press, 1981,
pp 25-74.
A summary appears in vol. 5 of the Encyclopedia of Science and Technology,
Academic Press, 1986, under 'Fortran'.
and in Chapter 1 of Fortran 90 Explained (Oxford, 1990).
--
----------------------------------------------------------------
Keith H. Bierman keith.bierman@Sun.COM| khb@chiba.Eng.Sun.COM
SunPro 2550 Garcia MTV 12-40 | (415 336 2648) fax 964 0946
Mountain View, CA 94043 <speaking for myself, not Sun*> Copyright 1992